import { createPinia } from 'pinia'
const store = createPinia()

import appPiniaStore from './modules/app';
import userPiniaStore from './modules/user';
import routesListPiniaStore from './modules/routesList';
export { appPiniaStore, userPiniaStore, routesListPiniaStore };

export const registerStore = () => {
    store.appStore = appPiniaStore()
    store.userStore = userPiniaStore()
    store.routesListStore = routesListPiniaStore()
}

/** 持久化*/
import piniaPluginPersist from 'pinia-plugin-persist'
store.use(piniaPluginPersist)

export default store
